package cn.kimmking.rpcdemo;

import cn.kimmking.kkrpc.core.annotation.EnableKkrpc;
import cn.kimmking.kkrpc.core.annotation.KKConsumer;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableKkrpc
public class RpcdemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(RpcdemoApplication.class, args);
    }

    @KKConsumer
    //@Autowired
    OrderService orderService;

    @Bean
    ApplicationRunner demo_runner() {
        return x -> {

            TripOrder order = orderService.query(1101);
            System.out.println(" ===> orderService.query : " + order);

        };
    }

}
